package com.bionic.CES.beans;

import java.io.Serializable;
import java.sql.Date;

public class Executedqueries implements Serializable {

    private Integer id;
    private Integer query;
    private Integer executedByUser;
    private Double rate;
    private Date closedDate;
    private String executionMethod;

    public Executedqueries() {
    }

    public Executedqueries(Integer query, Integer executedByUser, Double rate,
            Date closedDate) {
        super();
        this.query = query;
        this.executedByUser = executedByUser;
        this.rate = rate;
        this.closedDate = closedDate;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getQuery() {
        return query;
    }

    public void setQuery(Integer query) {
        this.query = query;
    }

    public Integer getExecutedByUser() {
        return executedByUser;
    }

    public void setExecutedByUser(Integer executedByUser) {
        this.executedByUser = executedByUser;
    }

    public Double getRate() {
        return rate;
    }

    public void setRate(Double rate) {
        this.rate = rate;
    }

    public Date getClosedDate() {
        return closedDate;
    }

    public void setClosedDate(Date closedDate) {
        this.closedDate = closedDate;
    }

    public String getExecutionMethod() {
        return executionMethod;
    }

    public void setExecutionMethod(String executionMethod) {
        this.executionMethod = executionMethod;
    }

    @Override
    public String toString() {
        return "Executedqueries [query=" + getQuery() + ", executedByUser="
                + getExecutedByUser() + ", rate=" + getRate() + ", closedDate="
                + getClosedDate() + ", executedByUser=" + getExecutedByUser() + "]";
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result
                + ((getClosedDate() == null) ? 0 : getClosedDate().hashCode());
        result = prime * result
                + ((getExecutedByUser() == null) ? 0 : getExecutedByUser().hashCode());
        result = prime * result
                + ((getExecutionMethod() == null) ? 0 : getExecutionMethod().hashCode());
        result = prime * result + ((getQuery() == null) ? 0 : getQuery().hashCode());
        long temp;
        temp = Double.doubleToLongBits(getRate());
        result = prime * result + (int) (temp ^ (temp >>> 32));
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof Executedqueries)) {
            return false;
        }
        Executedqueries other = (Executedqueries) obj;
        if (getClosedDate() == null) {
            if (other.getClosedDate() != null) {
                return false;
            }
        } else if (!closedDate.equals(other.closedDate)) {
            return false;
        }
        if (getExecutedByUser() == null) {
            if (other.getExecutedByUser() != null) {
                return false;
            }
        } else if (!executedByUser.equals(other.executedByUser)) {
            return false;
        }
        if (getExecutionMethod() == null) {
            if (other.getExecutionMethod() != null) {
                return false;
            }
        } else if (!executionMethod.equals(other.executionMethod)) {
            return false;
        }
        if (getQuery() == null) {
            if (other.getQuery() != null) {
                return false;
            }
        } else if (!query.equals(other.query)) {
            return false;
        }
        if (Double.doubleToLongBits(getRate()) != Double
                .doubleToLongBits(other.getRate())) {
            return false;
        }
        return true;
    }
}
